package com.taxshare.seller.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.taxshare.mybatis.entity.BaseEntity;
import com.taxshare.seller.constant.table.TableConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @ClassName: ALSCancelDetailLogEntity
 * @Description:
 * @author: hjh
 * @date: 2021/6/30 9:45
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(TableConstant.T_SELLER_INVOICE_DETAIL_CANCEL_LOG)
@ApiModel(description = "待开发票作废")
public class AlsCancelDetailLogEntity extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("uuid")
    @ApiModelProperty("主键")
    private String uuid;

    @TableField("serial_no")
    @ApiModelProperty("发票请求流水号")
    private String serialNo;

    @TableField("goods_name")
    @ApiModelProperty("商品名称")
    private String goodsName;

    @TableField("model")
    @ApiModelProperty("规格型号")
    private String model;

    @TableField("unit")
    @ApiModelProperty("单位")
    private String unit;

    @TableField("goods_number")
    @ApiModelProperty("数量")
    private String goodsNumber;

    @TableField("unit_price")
    @ApiModelProperty("单价")
    private String unitPrice;

    @TableField("goods_sum")
    @ApiModelProperty("不含税金额")
    private String goodsSum;

    @TableField("tax_rate")
    @ApiModelProperty("税率")
    @NotBlank(message = "税率不能为空")
    @Pattern(regexp = "0.\\d{1,2}$|0", message = "税率错误")
    private String taxRate;

    @TableField("goods_tax")
    @ApiModelProperty("税额")
    private String goodTax;

    @TableField("goods_sum_tax")
    @ApiModelProperty("含税金额")
    private String goodsSumTax;

    @TableField("tax_rate_mark")
    @ApiModelProperty("零税率标识（空为正常税率，1，是免税2，是不征税 3普通零税率）")
    private String taxRateMark;

    @TableField("preferential_mark")
    @ApiModelProperty("优惠政策标识（0无优惠政策 1有优惠政策）")
    private String preferentialMark;

    @TableField("preferential_name")
    @ApiModelProperty("优惠政策名称")
    private String preferentialName;

    @TableField("tax_code")
    @ApiModelProperty("税收分类编码")
    private String taxCode;

    @TableField("invoice_row_nature")
    @ApiModelProperty("发票行性质")
    private String invoiceRowNature;

    @TableField("detail_no")
    @ApiModelProperty("明细行序号")
    private String detailNo;

    @TableField("tax_sign")
    @ApiModelProperty(value = "含税标志")
    private String taxSign;

    @TableField("red_mark")
    @ApiModelProperty(value = "是否红冲标志")
    private String redMark;

    @TableField("prefer_mark")
    @ApiModelProperty(value = "增值税特殊管理(当preferFlag是1时必填\n" +
            "taxRateFlag为0填写 出口零税，taxRateFlag为1填写 免税，taxRateFlag为2填写 不征税)")
    private String preferMark;
}
